//
//  UIBarButtonItem+Extension.swift
//  ZMWB
//
//  Created by 朱敏 on 2017/9/25.
//  Copyright © 2017年 朱敏. All rights reserved.
//

import UIKit

extension UIBarButtonItem {
    convenience init( imageName: String, target: AnyObject, action: Selector) {
        let btn = UIButton()
        btn.setImage(UIImage(named:imageName), for: UIControlState.normal)
        btn.setImage(UIImage(named:imageName + "_highlighted"), for: UIControlState.highlighted)
        btn.sizeToFit()
        btn.addTarget(target, action: action, for: UIControlEvents.touchUpInside)
        self.init(customView: btn)
    }
}
